import { RECEVING_LIST_APP, RECEIVING_UPDATE_APP, RECEIVING_DELETE_APP, PROJECT_LIST_APP } from '@/config/url.conf'
import { ajax } from '@/utils/request';
/**
 * 获取收货信息
 * @param {*}params
 * @returns
 */
export function recevingListApi(params) {
    return ajax({
        url: RECEVING_LIST_APP,
        params
    })
}
export const receivingUpdate = (token) => {
    return ajax({
        method: "post",
        url: RECEIVING_UPDATE_APP,
        data: { token },
    });
};

export function receivingDeleteApi(id) {
    return ajax({
        url: RECEIVING_DELETE_APP + id,
        method: 'post'
    })
}
export function collectApi() {
    return ajax({ url: '/analysis/collection' })
}

export function purchaseListApi(params) {
    return ajax({
        url: '/purchase/list',
        params
    })
}

export function projectListApi(params) {
    return ajax({
        url: '/project/list',
        params
    })
}

export function supplierListApi(params) {
    return ajax({
        url: '/supplier/list',
        params
    })
}

export function userListApi(params) {
    return ajax({
        url: '/user/list',
        params
    })
}

export function productListApi() {
    return ajax({
        url: '/material/list'
    })
}

export function purchaseInfoApi(id) {
    return ajax({
        url: '/purchase/info',
        params: { id }
    })
}

export function purchaseSaveApi(data) {
    return ajax({
        url: '/purchase/save',
        method: 'post',
        data
    })
}

export function purchaseUpdateApi(data) {
    return ajax({
        url: '/purchase/update',
        method: 'post',
        data
    })
}

export function purchaseApproveApi(data) {
    return ajax({
        url: '/purchase/flow',
        method: 'post',
        data
    })
}

export function purchaseDeleteApi(id) {
    return ajax({
        // 是一个动态路由、接口
        // url: '/purchase/delete/:id',
        url: '/purchase/delete/' + id,
        method: 'post'
    })
}